<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="">{$title}</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="get" action="">
        关键字:
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$where_r.keyword|default=''}" placeholder="请输入关键字...">
        省份：
        <select class="form-control" name="sheng" id="sheng">
            <option value="0">未选择</option>
            <volist name="areas" id="vo">
                <option value="{$vo.areaid}" <eq name="vo.areaid" value="$where_r.sheng|default=0">selected</eq> >{$vo.name}</option>
            </volist>
        </select>
        市区：
        <select class="form-control" name="cite" id="cite">
            <option value="0">未选择</option>
        </select>
        转让类型:
        <select class="form-control" name="attorn" style="width: 80px;">
            <option value='0'>全部</option>
            <volist name="attorn" id="vo">
                <option value="{$vo.id}" <eq name="vo.id" value="$where_r.attorn|default=0">selected</eq> >{$vo.name}</option>
            </volist>
        </select> &nbsp;
        注册资本:
        <div class="input-group">
            <input type="number" class="form-control" name="min_registered_capital" value="{:input('min_registered_capital/s')}" style="width: 80px;">
            <span class="input-group-addon">—</span>
            <input type="number" class="form-control" name="max_registered_capital" value="{:input('min_registered_capital/s')}" style="width: 80px;">
        </div>
         &nbsp;
        成立年限:
        <select class="form-control" name="regtime" style="width: 80px;">
            <option value='0'>不限</option>
            <option value='1' <eq name=":input('regtime')" value="1">selected</eq> >1年内</option>
            <option value='2' <eq name=":input('regtime')" value="2">selected</eq> >1-2年</option>
            <option value='3' <eq name=":input('regtime')" value="3">selected</eq> >2-3年</option>
            <option value='4' <eq name=":input('regtime')" value="4">selected</eq> >3-5年</option>
            <option value='5' <eq name=":input('regtime')" value="5">selected</eq> >5-10年</option>
            <option value='6' <eq name=":input('regtime')" value="6">selected</eq> >10年以上</option>
        </select> &nbsp;
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:cmf_url()}">清空</a>
    </form>
    <div class="table-actions">
        <div class="btn-group">
            <if condition="auth_check('add')"><a href="{:url('add')}" class="btn btn-default">新增</a></if>
        </div>
    </div>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <!-- <th width="50">ID</th> -->
            <th>录入时间</th>
            <th>企业名称</th>
            <th>需求类型</th>
            <!--<th>法定代表人</th>-->
            <th>成立日期</th>
            <th>注册资本</th>
            <!--<th>地址</th>-->
            <!--<th>邮箱</th>-->
            <!--<th>电话号码</th>-->
            <!--<th>经营范围</th>-->
            <!--<th>备注</th>-->
            <th>跟进</th>
            <th>锁定人</th>
            <th>创建人</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="lists" item="vo">
            <tr>
                <!-- <td>{$vo.id}</td> -->
                <td>{$vo.create_time|date="Y-m-d",###}</td>
                <td>{$vo.name}</td>
                <td data-toggle="collapse" data-parent="#accordion" data-target="#list-{$vo.id}">{$vo.company}</td>
                <!--<td>{$vo.corporation}</td>-->
                <td>{$vo.regtime|date="Y-m-d",###}</td>
                <td>{$vo.registered_capital|floatval}万{$vo.cname}</td>
                <!--<td>{$vo.address}</td>-->
                <!--<td>{$vo.email}</td>-->
                <!--<td>{$vo.phone}</td>-->
                <!--<td>{$vo.scope}</td>-->
                <!--<td class="remark">{$vo.remark}</td>-->
                <td>{$vo.evolve}</td>
                <td>{$vo.lname}</td>
                <td>{$vo.user_nickname}</td>
                <td>
                    <!--<span class="edit_remark" data-id="{$vo.id}">修改</span>-->
                    <if condition="auth_check('show')">
                        <a href='javascript:parent.openIframeLayer("{:url("show",["pid" => $vo["id"]])}","资源跟进记录")'">跟进记录</a>
                    </if>
                </td>
            </tr>
            <tr>
                <td colspan="9">
                    <ul id="list-{$vo.id}" class="panel-collapse collapse default-ul clearfix">
                        <li class="col-md-3">法定代表人:{$vo.corporation}</li>
                        <li class="col-md-5">地址:{$vo.address}</li>
                        <li class="col-md-2">邮箱:{$vo.email}</li>
                        <li class="col-md-2">电话号码:{$vo.phone}</li>
                        <li class="col-md-12">经营范围:{$vo.scope}</li>
                        <li class="col-md-12">备注:{$vo.remark}</li>
                    </ul>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="pagination">{$page}
        <li><a>共计 {$lists->total()} 条</a><li>
			<input class="page" type="text" name="pageNum" value="{$lists->getCurrentPage()}"/>
			<a class="topage" data-url="{$lists->getCurrentPath()}">跳转</a>
			</li></li>
    </div>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    $(function(){
        var def = "{$where_r.cite|default=0}";
        changecite(def);
        $('#sheng').change(function(){
            changecite();
        });
    })
    function changecite(def){
        var val = $('#sheng').val();
        $('#cite').html('<option value="0">未选择</option>');
        if(val !== 0){
            $.ajax({
                url:"{:cmf_url('rongcui/areas/area')}",
                data:{areaid:val},
                success:function(data){
                    $.each(data.data,function(key,item){
                        var select = '';
                        if(def !== undefined) {
                            if(def == item.areaid) {
                                select = ' selected ';
                            }
                        }
                        $('#cite').append('<option value="'+item.areaid+'" ' +select+'>'+item.name+'</option>');
                    })
                    console.log(data);
                }
            })
        }
    }
</script>
</body>
</html>